<?php if (is_null($post->getPostId())) : ?>
<h2 class="prefix_1 grid_8">New Post</h2>
<?php else : ?>
<h2 class="prefix_1 grid_8">Edit Post</h2>
<?php endif; ?>

<?php if ($currentUserName === false) : ?>
<div id="sign-in" class="prefix_1 grid_8">
	<a href="<?php echo site_url('auth'); ?>">
		<img src="/img/Sign-in-with-Twitter-lighter.png" alt="Sign in with Twitter" />
	</a>
</div>
<?php endif; ?>

<?php echo form_open('editPost' . (is_null($post->getPostId()) ? '' : '/' . $post->getPostId()), array('id'=>'editPost-newPostForm')); ?>

<?php echo form_hidden('clickframesFormId', 'editPost-newPostForm'); ?>

<?php echo form_label('Title', 'title', array('class'=>'grid_1')); ?>
<div class="grid_5 suffix_3">
	<?php echo form_input(array('name'=>'title', 'id'=>'title', 'value'=>set_value('title', $post->getTitle()), 'class'=>'width_5')); ?>
	<span id="title_message"><?php echo form_error('title'); ?></span>
</div>
<div class="clear"></div>

<?php echo form_label('Content', 'content', array('class'=>'grid_1')); ?>
<div class="grid_5">
	<?php echo form_textarea(array('name'=>'content', 'id'=>'content', 'value'=>set_value('content', $post->getContent()), 'class'=>'width_5')); ?>
	<span id="content_message"><?php echo form_error('content'); ?>
</div>
<div class="grid_3 inline-help">
	<ul id="markdown-help">
		<li># First-level header</li>
		<li>## Second-level header</li>
		<li>### Third-level header</li>
		<li>_italic text_</li>
		<li>__bold text__</li>
		<li>[link text](http://foo.com)</li>
		<li>&gt; Block quote</li>
		<li>* Bulleted list item</li>
		<li>1. Ordered list item</li>
		<li>    Code block (4 spaces)</li>
		<li>![alt text](/path/to/img.jpg)</li>
	</ul>
	<a target="_blank" href="http://daringfireball.net/projects/markdown/syntax">Full Markdown Syntax</a>
</div>
<div class="clear"></div>

<div class="prefix_1 grid_8">
	<?php echo form_submit(array('name'=>'action:publish', 'id'=>'action:publish', 'class'=>'width_2'), 'Publish'); ?>
</div>
<div class="clear"></div>
<?php echo form_close(); ?>

<?php if ($currentUserName === false) : ?>
<script type="text/javascript">
	disableForm('editPost-newPostForm');
</script>
<?php endif; ?>

<?php /* clickframes::version=1715627125::clickframes */ ?>